# Contributor: Antoine Fontaine <antoine.fontaine@epfl.ch>
# Maintainer:
pkgname=reprotest
_pyname=reprotest
pkgver=0.7.26
pkgrel=1
pkgdesc="Build packages and check them for reproducibility"
url="https://salsa.debian.org/reproducible-builds/reprotest"
arch="noarch !armv7 !x86 !armhf" # diffoscope
license="GPL-3.0-or-later"
depends="diffoscope py3-rstr py3-distro py3-setuptools"
makedepends="
	py3-gpep517
	py3-wheel
	"
checkdepends="dpkg py3-pytest"
_pypiprefix="${_pyname%"${_pyname#?}"}"
subpackages="$pkgname-pyc"
source="https://salsa.debian.org/reproducible-builds/reprotest/-/archive/$pkgver/reprotest-$pkgver.tar.gz"
options="!check" # missing disorderfs

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
f66d99253c38867918a88893ad553b72cf394c2da71823cebbdeab2d0038ab5d82d55838edc1e4534f80d1e534235b6d3ff945ad3dc21aff9059a0ff54a84aae  reprotest-0.7.26.tar.gz
"
